<?php

namespace common\models\marathon;

use Yii;

/**
 * This is the model class for table "{{%marathon_number}}".
 *
 * @property int $id
 * @property int $rule_id 牌号规则
 * @property int $match_id 比赛ID
 * @property int $item_id 比赛项目ID
 * @property string $group 组别
 * @property string $number 号码
 * @property int $reserved 0默认，1为系统保留号码
 * @property int $disabled 0为未占用，1为已占用
 */
class MarathonNumber extends \common\db\ActiveRecord {

    /**
     * {@inheritdoc}
     */
    public static function tableName() {
        return '{{%marathon_number}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules() {
        return [
            [['rule_id', 'match_id', 'item_id', 'reserved', 'disabled'], 'integer'],
            [['group', 'number'], 'required'],
            [['group'], 'string', 'max' => 2],
            [['number'], 'string', 'max' => 10],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels() {
        return [
            'id' => 'ID',
            'rule_id' => '牌号规则',
            'match_id' => '比赛ID',
            'item_id' => '比赛项目ID',
            'group' => '组别',
            'number' => '号码',
            'reserved' => '0默认，1为系统保留号码',
            'disabled' => '0为未占用，1为已占用',
        ];
    }

}
